package com.restaurant.application.exchangegoods.support;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import com.nebutown.generation.basictype.UID;
import java.lang.Long;
import java.lang.String;
import java.util.List;

public class ExchangeGoodsData implements PickableBean {
    
    public static final String FN_GOODSUID = "goodsUID";
    public static final String FN_GOODSNAME = "goodsName";
    public static final String FN_GOODSID = "goodsId";
    public static final String FN_CUSTOMERUID = "customerUID";
    public static final String FN_USESTARTTIME = "useStartTime";
    public static final String FN_CUSTOMERID = "customerId";
    public static final String FN_NICKNAME = "nickName";
    public static final String FN_PHONE = "phone";
    public static final String FN_ACCUMULATE = "accumulate";
    public static final String FN_USEENDTIME = "useEndTime";
    public static final String FN_STATE = "state";
    public static final String FN_COUPONUID = "couponUID";
    public static final String FN_EXCHANGETIME = "exchangeTime";
    
    public static final List<String> FIELD_NAMES = Lists.newArrayList(
             FN_GOODSUID,
             FN_GOODSNAME,
             FN_GOODSID,
             FN_CUSTOMERUID,
             FN_USESTARTTIME,
             FN_CUSTOMERID,
             FN_NICKNAME,
             FN_PHONE,
             FN_ACCUMULATE,
             FN_USEENDTIME,
             FN_STATE,
             FN_COUPONUID,
             FN_EXCHANGETIME);
    
    private UID goodsUID;
    private String goodsName;
    private String goodsId;
    private UID customerUID;
    private String useStartTime;
    private String customerId;
    private String nickName;
    private String phone;
    private Long accumulate;
    private Long useEndTime;
    private String state;
    private UID couponUID;
    private Long exchangeTime;
    
    public ExchangeGoodsData(UID goodsUID, String goodsName, String goodsId, UID customerUID, String useStartTime, String customerId, String nickName, String phone, Long accumulate, Long useEndTime, String state, UID couponUID, Long exchangeTime) {
        setGoodsUID(goodsUID);
        setGoodsName(goodsName);
        setGoodsId(goodsId);
        setCustomerUID(customerUID);
        setUseStartTime(useStartTime);
        setCustomerId(customerId);
        setNickName(nickName);
        setPhone(phone);
        setAccumulate(accumulate);
        setUseEndTime(useEndTime);
        setState(state);
        setCouponUID(couponUID);
        setExchangeTime(exchangeTime);
    }
    
    public ExchangeGoodsData() {
    }
    
    public ExchangeGoodsData duplicate() {
        ExchangeGoodsData result = new ExchangeGoodsData();
        result.goodsUID = this.goodsUID;
        result.goodsName = this.goodsName;
        result.goodsId = this.goodsId;
        result.customerUID = this.customerUID;
        result.useStartTime = this.useStartTime;
        result.customerId = this.customerId;
        result.nickName = this.nickName;
        result.phone = this.phone;
        result.accumulate = this.accumulate;
        result.useEndTime = this.useEndTime;
        result.state = this.state;
        result.couponUID = this.couponUID;
        result.exchangeTime = this.exchangeTime;
        return result;
    }
    
    @Override
    public String toString() {
        return Convert.toJson(this);
    }
    
    public UID getGoodsUID() {
        return goodsUID;
    }
    
    public void  setGoodsUID(UID value) {
        this.goodsUID = value;
    }
    
    public ExchangeGoodsData withGoodsUID(UID value) {
        setGoodsUID(value);
        return this;
    }
    
    public ExchangeGoodsData withGoodsUID(UID value, UID defaultValue) {
        setGoodsUID(value == null ? defaultValue : value);
        return this;
    }
    
    public String getGoodsName() {
        return goodsName;
    }
    
    public void  setGoodsName(String value) {
        this.goodsName = value;
    }
    
    public ExchangeGoodsData withGoodsName(String value) {
        setGoodsName(value);
        return this;
    }
    
    public ExchangeGoodsData withGoodsName(String value, String defaultValue) {
        setGoodsName(value == null ? defaultValue : value);
        return this;
    }
    
    public String getGoodsId() {
        return goodsId;
    }
    
    public void  setGoodsId(String value) {
        this.goodsId = value;
    }
    
    public ExchangeGoodsData withGoodsId(String value) {
        setGoodsId(value);
        return this;
    }
    
    public ExchangeGoodsData withGoodsId(String value, String defaultValue) {
        setGoodsId(value == null ? defaultValue : value);
        return this;
    }
    
    public UID getCustomerUID() {
        return customerUID;
    }
    
    public void  setCustomerUID(UID value) {
        this.customerUID = value;
    }
    
    public ExchangeGoodsData withCustomerUID(UID value) {
        setCustomerUID(value);
        return this;
    }
    
    public ExchangeGoodsData withCustomerUID(UID value, UID defaultValue) {
        setCustomerUID(value == null ? defaultValue : value);
        return this;
    }
    
    public String getUseStartTime() {
        return useStartTime;
    }
    
    public void  setUseStartTime(String value) {
        this.useStartTime = value;
    }
    
    public ExchangeGoodsData withUseStartTime(String value) {
        setUseStartTime(value);
        return this;
    }
    
    public ExchangeGoodsData withUseStartTime(String value, String defaultValue) {
        setUseStartTime(value == null ? defaultValue : value);
        return this;
    }
    
    public String getCustomerId() {
        return customerId;
    }
    
    public void  setCustomerId(String value) {
        this.customerId = value;
    }
    
    public ExchangeGoodsData withCustomerId(String value) {
        setCustomerId(value);
        return this;
    }
    
    public ExchangeGoodsData withCustomerId(String value, String defaultValue) {
        setCustomerId(value == null ? defaultValue : value);
        return this;
    }
    
    public String getNickName() {
        return nickName;
    }
    
    public void  setNickName(String value) {
        this.nickName = value;
    }
    
    public ExchangeGoodsData withNickName(String value) {
        setNickName(value);
        return this;
    }
    
    public ExchangeGoodsData withNickName(String value, String defaultValue) {
        setNickName(value == null ? defaultValue : value);
        return this;
    }
    
    public String getPhone() {
        return phone;
    }
    
    public void  setPhone(String value) {
        this.phone = value;
    }
    
    public ExchangeGoodsData withPhone(String value) {
        setPhone(value);
        return this;
    }
    
    public ExchangeGoodsData withPhone(String value, String defaultValue) {
        setPhone(value == null ? defaultValue : value);
        return this;
    }
    
    public Long getAccumulate() {
        return accumulate;
    }
    
    public void  setAccumulate(Long value) {
        this.accumulate = value;
    }
    
    public ExchangeGoodsData withAccumulate(Long value) {
        setAccumulate(value);
        return this;
    }
    
    public ExchangeGoodsData withAccumulate(Long value, Long defaultValue) {
        setAccumulate(value == null ? defaultValue : value);
        return this;
    }
    
    public Long getUseEndTime() {
        return useEndTime;
    }
    
    public void  setUseEndTime(Long value) {
        this.useEndTime = value;
    }
    
    public ExchangeGoodsData withUseEndTime(Long value) {
        setUseEndTime(value);
        return this;
    }
    
    public ExchangeGoodsData withUseEndTime(Long value, Long defaultValue) {
        setUseEndTime(value == null ? defaultValue : value);
        return this;
    }
    
    public String getState() {
        return state;
    }
    
    public void  setState(String value) {
        this.state = value;
    }
    
    public ExchangeGoodsData withState(String value) {
        setState(value);
        return this;
    }
    
    public ExchangeGoodsData withState(String value, String defaultValue) {
        setState(value == null ? defaultValue : value);
        return this;
    }
    
    public UID getCouponUID() {
        return couponUID;
    }
    
    public void  setCouponUID(UID value) {
        this.couponUID = value;
    }
    
    public ExchangeGoodsData withCouponUID(UID value) {
        setCouponUID(value);
        return this;
    }
    
    public ExchangeGoodsData withCouponUID(UID value, UID defaultValue) {
        setCouponUID(value == null ? defaultValue : value);
        return this;
    }
    
    public Long getExchangeTime() {
        return exchangeTime;
    }
    
    public void  setExchangeTime(Long value) {
        this.exchangeTime = value;
    }
    
    public ExchangeGoodsData withExchangeTime(Long value) {
        setExchangeTime(value);
        return this;
    }
    
    public ExchangeGoodsData withExchangeTime(Long value, Long defaultValue) {
        setExchangeTime(value == null ? defaultValue : value);
        return this;
    }
    
    public Object getValueOf(String name) {
        switch(name) {
        case "goodsUID": return getGoodsUID();
        case "goodsName": return getGoodsName();
        case "goodsId": return getGoodsId();
        case "customerUID": return getCustomerUID();
        case "useStartTime": return getUseStartTime();
        case "customerId": return getCustomerId();
        case "nickName": return getNickName();
        case "phone": return getPhone();
        case "accumulate": return getAccumulate();
        case "useEndTime": return getUseEndTime();
        case "state": return getState();
        case "couponUID": return getCouponUID();
        case "exchangeTime": return getExchangeTime();
        }
        return null;
    }
    
    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }
    
    @Override
    public int hashCode() {
        return signature().hashCode();
    }
    
    @Override
    public boolean equals(Object o) {
        if(!(o instanceof ExchangeGoodsData)) return false;
        return signature().equals(((ExchangeGoodsData)o).signature());
    }
    
    public String signature() {
        throw new RuntimeException("Bean ExchangeGoodsData has no signature defined, no hash code or equals possible.");
    }
}
